package com.ldl.exam.dao;

import com.ldl.exam.entity.Question;
import com.ldl.exam.entity.QuestionExample;
import com.ldl.exam.entity.QuestionWithBLOBs;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface QuestionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(QuestionWithBLOBs record);

    int insertSelective(QuestionWithBLOBs record);

    List<QuestionWithBLOBs> selectByExampleWithBLOBs(QuestionExample example);

    List<Question> selectByExample(QuestionExample example);

    QuestionWithBLOBs selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(QuestionWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(QuestionWithBLOBs record);

    int updateByPrimaryKey(Question record);

    List<QuestionWithBLOBs> selectQuestionsHasAnswerByExamPaperId(@Param("examPaperId") Integer examPaperId, @Param("typeId")Integer typeId);
    List<QuestionWithBLOBs> selectQuestionsNoAnswerByExamPaperId(@Param("examPaperId") Integer examPaperId, @Param("typeId")Integer typeId);
    List<QuestionWithBLOBs> selectQuestionsByTypeAndLanguage(@Param("typeId")Integer typeId, @Param("language") String language);

}